home *** CD-ROM | disk | FTP | other *** search
/ Software of the Month Club 2000 October / Software of the Month - Ultimate Collection Shareware 277.iso / pc / PROGRAMS / UTILITY / WINLINUX / DATA1.CAB / programs_-_include / ASM-MIPS / SERIAL.H < prev    next >
C/C++ Source or Header  |  1999-09-17  |  6KB  |  150 lines

  1. /* $Id: serial.h,v 1.3 1998/08/28 15:55:38 ralf Exp $
  2.  *
  3.  * include/asm-mips/serial.h
  4.  */
  5. #include <linux/config.h>
  6. #include <asm/bootinfo.h>
  7. #include <asm/jazz.h>
  8.  
  9. /*
  10.  * This assumes you have a 1.8432 MHz clock for your UART.
  11.  *
  12.  * It'd be nice if someone built a serial card with a 24.576 MHz
  13.  * clock, since the 16550A is capable of handling a top speed of 1.5
  14.  * megabits/second; but this requires the faster clock.
  15.  */
  16. #define BASE_BAUD ( 1843200 / 16 )
  17.  
  18. #ifndef CONFIG_OLIVETTI_M700
  19. /* Some Jazz machines seem to have an 8MHz crystal clock but I don't know
  20.    exactly which ones ... XXX */
  21. #define JAZZ_BASE_BAUD ( 8000000 / 16 ) /* ( 3072000 / 16) */
  22. #else
  23. /* but the M700 isn't such a strange beast */
  24. #define JAZZ_BASE_BAUD BASE_BAUD
  25. #endif
  26.  
  27. /* Standard COM flags (except for COM4, because of the 8514 problem) */
  28. #ifdef CONFIG_SERIAL_DETECT_IRQ
  29. #define STD_COM_FLAGS (ASYNC_BOOT_AUTOCONF | ASYNC_SKIP_TEST | ASYNC_AUTO_IRQ)
  30. #define STD_COM4_FLAGS (ASYNC_BOOT_AUTOCONF | ASYNC_AUTO_IRQ)
  31. #else
  32. #define STD_COM_FLAGS (ASYNC_BOOT_AUTOCONF | ASYNC_SKIP_TEST)
  33. #define STD_COM4_FLAGS ASYNC_BOOT_AUTOCONF
  34. #endif
  35.  
  36. #ifdef CONFIG_SERIAL_MANY_PORTS
  37. #define FOURPORT_FLAGS ASYNC_FOURPORT
  38. #define ACCENT_FLAGS 0
  39. #define BOCA_FLAGS 0
  40. #define HUB6_FLAGS 0
  41. #endif
  42.  
  43. /*
  44.  * The following define the access methods for the HUB6 card. All
  45.  * access is through two ports for all 24 possible chips. The card is
  46.  * selected through the high 2 bits, the port on that card with the
  47.  * "middle" 3 bits, and the register on that port with the bottom
  48.  * 3 bits.
  49.  *
  50.  * While the access port and interrupt is configurable, the default
  51.  * port locations are 0x302 for the port control register, and 0x303
  52.  * for the data read/write register. Normally, the interrupt is at irq3
  53.  * but can be anything from 3 to 7 inclusive. Note that using 3 will
  54.  * require disabling com2.
  55.  */
  56.  
  57. #define C_P(card,port) (((card)<<6|(port)<<3) + 1)
  58.  
  59. #ifdef CONFIG_MIPS_JAZZ
  60. #define JAZZ_SERIAL_PORT_DEFNS            \
  61.     /* UART CLK   PORT IRQ     FLAGS        */            \
  62.     { 0, JAZZ_BASE_BAUD, JAZZ_SERIAL1_BASE,         /* ttyS0 */    \
  63.       JAZZ_SERIAL1_IRQ, STD_COM_FLAGS },                \
  64.     { 0, JAZZ_BASE_BAUD, JAZZ_SERIAL2_BASE,         /* ttyS1 */    \
  65.       JAZZ_SERIAL2_IRQ, STD_COM_FLAGS },
  66. #else
  67. #define JAZZ_SERIAL_PORT_DEFNS
  68. #endif
  69.  
  70. #define STD_SERIAL_PORT_DEFNS            \
  71.     /* UART CLK   PORT IRQ     FLAGS        */            \
  72.     { 0, BASE_BAUD, 0x3F8, 4, STD_COM_FLAGS },    /* ttyS0 */    \
  73.     { 0, BASE_BAUD, 0x2F8, 3, STD_COM_FLAGS },    /* ttyS1 */    \
  74.     { 0, BASE_BAUD, 0x3E8, 4, STD_COM_FLAGS },    /* ttyS2 */    \
  75.     { 0, BASE_BAUD, 0x2E8, 3, STD_COM4_FLAGS },    /* ttyS3 */
  76.  
  77.  
  78. #ifdef CONFIG_SERIAL_MANY_PORTS
  79. #define EXTRA_SERIAL_PORT_DEFNS            \
  80.     { 0, BASE_BAUD, 0x1A0, 9, FOURPORT_FLAGS },     /* ttyS4 */    \
  81.     { 0, BASE_BAUD, 0x1A8, 9, FOURPORT_FLAGS },    /* ttyS5 */    \
  82.     { 0, BASE_BAUD, 0x1B0, 9, FOURPORT_FLAGS },    /* ttyS6 */    \
  83.     { 0, BASE_BAUD, 0x1B8, 9, FOURPORT_FLAGS },    /* ttyS7 */    \
  84.     { 0, BASE_BAUD, 0x2A0, 5, FOURPORT_FLAGS },    /* ttyS8 */    \
  85.     { 0, BASE_BAUD, 0x2A8, 5, FOURPORT_FLAGS },    /* ttyS9 */    \
  86.     { 0, BASE_BAUD, 0x2B0, 5, FOURPORT_FLAGS },    /* ttyS10 */    \
  87.     { 0, BASE_BAUD, 0x2B8, 5, FOURPORT_FLAGS },    /* ttyS11 */    \
  88.     { 0, BASE_BAUD, 0x330, 4, ACCENT_FLAGS },    /* ttyS12 */    \
  89.     { 0, BASE_BAUD, 0x338, 4, ACCENT_FLAGS },    /* ttyS13 */    \
  90.     { 0, BASE_BAUD, 0x000, 0, 0 },    /* ttyS14 (spare) */        \
  91.     { 0, BASE_BAUD, 0x000, 0, 0 },    /* ttyS15 (spare) */        \
  92.     { 0, BASE_BAUD, 0x100, 12, BOCA_FLAGS },    /* ttyS16 */    \
  93.     { 0, BASE_BAUD, 0x108, 12, BOCA_FLAGS },    /* ttyS17 */    \
  94.     { 0, BASE_BAUD, 0x110, 12, BOCA_FLAGS },    /* ttyS18 */    \
  95.     { 0, BASE_BAUD, 0x118, 12, BOCA_FLAGS },    /* ttyS19 */    \
  96.     { 0, BASE_BAUD, 0x120, 12, BOCA_FLAGS },    /* ttyS20 */    \
  97.     { 0, BASE_BAUD, 0x128, 12, BOCA_FLAGS },    /* ttyS21 */    \
  98.     { 0, BASE_BAUD, 0x130, 12, BOCA_FLAGS },    /* ttyS22 */    \
  99.     { 0, BASE_BAUD, 0x138, 12, BOCA_FLAGS },    /* ttyS23 */    \
  100.     { 0, BASE_BAUD, 0x140, 12, BOCA_FLAGS },    /* ttyS24 */    \
  101.     { 0, BASE_BAUD, 0x148, 12, BOCA_FLAGS },    /* ttyS25 */    \
  102.     { 0, BASE_BAUD, 0x150, 12, BOCA_FLAGS },    /* ttyS26 */    \
  103.     { 0, BASE_BAUD, 0x158, 12, BOCA_FLAGS },    /* ttyS27 */    \
  104.     { 0, BASE_BAUD, 0x160, 12, BOCA_FLAGS },    /* ttyS28 */    \
  105.     { 0, BASE_BAUD, 0x168, 12, BOCA_FLAGS },    /* ttyS29 */    \
  106.     { 0, BASE_BAUD, 0x170, 12, BOCA_FLAGS },    /* ttyS30 */    \
  107.     { 0, BASE_BAUD, 0x178, 12, BOCA_FLAGS },    /* ttyS31 */
  108. #else
  109. #define EXTRA_SERIAL_PORT_DEFNS
  110. #endif
  111.  
  112. /* You can have up to four HUB6's in the system, but I've only
  113.  * included two cards here for a total of twelve ports.
  114.  */
  115. #if (defined(CONFIG_HUB6) && defined(CONFIG_SERIAL_MANY_PORTS))
  116. #define HUB6_SERIAL_PORT_DFNS        \
  117.     { 0, BASE_BAUD, 0x302, 3, HUB6_FLAGS, C_P(0,0) },  /* ttyS32 */    \
  118.     { 0, BASE_BAUD, 0x302, 3, HUB6_FLAGS, C_P(0,1) },  /* ttyS33 */    \
  119.     { 0, BASE_BAUD, 0x302, 3, HUB6_FLAGS, C_P(0,2) },  /* ttyS34 */    \
  120.     { 0, BASE_BAUD, 0x302, 3, HUB6_FLAGS, C_P(0,3) },  /* ttyS35 */    \
  121.     { 0, BASE_BAUD, 0x302, 3, HUB6_FLAGS, C_P(0,4) },  /* ttyS36 */    \
  122.     { 0, BASE_BAUD, 0x302, 3, HUB6_FLAGS, C_P(0,5) },  /* ttyS37 */    \
  123.     { 0, BASE_BAUD, 0x302, 3, HUB6_FLAGS, C_P(1,0) },  /* ttyS38 */    \
  124.     { 0, BASE_BAUD, 0x302, 3, HUB6_FLAGS, C_P(1,1) },  /* ttyS39 */    \
  125.     { 0, BASE_BAUD, 0x302, 3, HUB6_FLAGS, C_P(1,2) },  /* ttyS40 */    \
  126.     { 0, BASE_BAUD, 0x302, 3, HUB6_FLAGS, C_P(1,3) },  /* ttyS41 */    \
  127.     { 0, BASE_BAUD, 0x302, 3, HUB6_FLAGS, C_P(1,4) },  /* ttyS42 */    \
  128.     { 0, BASE_BAUD, 0x302, 3, HUB6_FLAGS, C_P(1,5) },  /* ttyS43 */
  129. #else
  130. #define HUB6_SERIAL_PORT_DFNS
  131. #endif
  132.  
  133. #ifdef CONFIG_MCA
  134. #define MCA_SERIAL_PORT_DFNS            \
  135.     { 0, BASE_BAUD, 0x3220, 3, STD_COM_FLAGS },    \
  136.     { 0, BASE_BAUD, 0x3228, 3, STD_COM_FLAGS },    \
  137.     { 0, BASE_BAUD, 0x4220, 3, STD_COM_FLAGS },    \
  138.     { 0, BASE_BAUD, 0x4228, 3, STD_COM_FLAGS },    \
  139.     { 0, BASE_BAUD, 0x5220, 3, STD_COM_FLAGS },    \
  140.     { 0, BASE_BAUD, 0x5228, 3, STD_COM_FLAGS },
  141. #else
  142. #define MCA_SERIAL_PORT_DFNS
  143. #endif
  144.  
  145. #define SERIAL_PORT_DFNS        \
  146.     JAZZ_SERIAL_PORT_DEFNS        \
  147.     STD_SERIAL_PORT_DEFNS        \
  148.     EXTRA_SERIAL_PORT_DEFNS        \
  149.     HUB6_SERIAL_PORT_DFNS
  150.